package com.hsc.yalebao.tabMine;

import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.text.Editable;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.widget.EditText;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.PopupWindow.OnDismissListener;
import android.widget.RelativeLayout;
import android.widget.Spinner;
import android.widget.TextView;
import com.hsc.yalebao.base.BaseActivity;
import com.hsc.yalebao.base.CustomApplication;
import com.hsc.yalebao.tools.DateUtil;
import com.hsc.yalebao.tools.UiUtil;
import com.hsc.yalebao.weight.LogUtils;
import com.hsc.yalebao.weight.NumberPicker;
import com.hsc.yalebao.weight.NumberPicker.OnValueChangeListener;
import java.util.Calendar;

public class JiLuActivity extends BaseActivity
  implements View.OnClickListener, NumberPicker.OnValueChangeListener
{
  private String TAG = "JiLuActivity";
  private Calendar calendar;
  private View contentView;
  private Context context;
  private NumberPicker day_numberpicker;
  private EditText et_begin_time;
  private EditText et_end_tiem;
  private EditText et_game_type;
  private EditText et_record_type;
  private GridView gv_home;
  private ImageView img_begin_time;
  private ImageView img_qd;
  private ImageView img_xiala_end_time;
  private ImageView img_xiala_game_type;
  private ImageView img_xiala_record_type;
  private ImageView iv_title_right;
  private LinearLayout lin_record_type;
  private int mDay;
  private int mDay1;
  private int mMonth;
  private int mMonth1;
  private int mYear;
  private int mYear1;
  private NumberPicker month_numberpicker;
  View.OnClickListener onClickListener = new View.OnClickListener()
  {
    public void onClick(View paramAnonymousView)
    {
      switch (paramAnonymousView.getId())
      {
      case 2131099704:
      default:
        return;
      case 2131099699:
        CustomApplication.app.finishActivity(JiLuActivity.this);
        return;
      case 2131099862:
      case 2131099864:
        JiLuActivity.this.showgametypePopwindow();
        return;
      case 2131099867:
      case 2131099868:
        JiLuActivity.this.showrecordtypePopwindow();
        return;
      case 2131099870:
      case 2131099871:
        JiLuActivity.this.showbegintimePopwindow();
        return;
      case 2131099872:
      case 2131099874:
      }
      JiLuActivity.this.showendtimePopwindow();
    }
  };
  PopupWindow popupWindowEnd;
  PopupWindow popupWindowstart;
  private RelativeLayout rl_end_time;
  private RelativeLayout rl_game_type;
  Spinner spinner = null;
  private View view_title;

  @SuppressLint({"NewApi"})
  @TargetApi(12)
  private void showbegintimePopwindow()
  {
    this.img_begin_time.setImageResource(2130837882);
    View localView = LayoutInflater.from(this.context).inflate(2130903178, null);
    int i = 6 * (CustomApplication.app.displayMetrics.widthPixels / 10);
    NumberPicker localNumberPicker;
    int j;
    int k;
    if (this.popupWindowstart == null)
    {
      this.popupWindowstart = new PopupWindow(localView, -2, -2, true);
      LinearLayout localLinearLayout = (LinearLayout)localView.findViewById(2131099762);
      ViewGroup.LayoutParams localLayoutParams = localLinearLayout.getLayoutParams();
      localLayoutParams.width = i;
      localLinearLayout.setLayoutParams(localLayoutParams);
      this.day_numberpicker = ((NumberPicker)localView.findViewById(2131100237));
      this.day_numberpicker.setMinValue(1);
      this.day_numberpicker.setMaxValue(30);
      this.mDay = this.calendar.get(5);
      this.day_numberpicker.setValue(this.mDay);
      localNumberPicker = (NumberPicker)localView.findViewById(2131100234);
      localNumberPicker.setMaxValue(this.calendar.get(1));
      localNumberPicker.setMinValue(2015);
      this.mYear = this.calendar.get(1);
      localNumberPicker.setValue(this.mYear);
      j = localNumberPicker.getValue();
      this.month_numberpicker = ((NumberPicker)localView.findViewById(2131100236));
      this.month_numberpicker.setMaxValue(12);
      this.month_numberpicker.setMinValue(1);
      this.mMonth = (1 + this.calendar.get(2));
      this.month_numberpicker.setValue(this.mMonth);
      k = this.month_numberpicker.getValue();
      if ((k != 1) && (k != 3) && (k != 5) && (k != 7) && (k != 8) && (k != 10) && (k != 12))
        break label431;
      this.day_numberpicker.setMaxValue(31);
    }
    while (true)
    {
      localNumberPicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener()
      {
        public void onValueChange(NumberPicker paramAnonymousNumberPicker, int paramAnonymousInt1, int paramAnonymousInt2)
        {
          JiLuActivity.this.mYear = paramAnonymousInt2;
        }
      });
      this.month_numberpicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener()
      {
        public void onValueChange(NumberPicker paramAnonymousNumberPicker, int paramAnonymousInt1, int paramAnonymousInt2)
        {
          JiLuActivity.this.mMonth = paramAnonymousInt2;
          if ((paramAnonymousInt2 == 1) || (paramAnonymousInt2 == 3) || (paramAnonymousInt2 == 5) || (paramAnonymousInt2 == 7) || (paramAnonymousInt2 == 8) || (paramAnonymousInt2 == 10) || (paramAnonymousInt2 == 12))
            JiLuActivity.this.day_numberpicker.setMaxValue(31);
          while (true)
          {
            LogUtils.i(JiLuActivity.this.TAG, "mMonth:" + JiLuActivity.this.mMonth);
            return;
            if ((paramAnonymousInt2 == 4) || (paramAnonymousInt2 == 6) || (paramAnonymousInt2 == 9) || (paramAnonymousInt2 == 11))
              JiLuActivity.this.day_numberpicker.setMaxValue(30);
            else if (JiLuActivity.this.mYear / 4 == 0)
              JiLuActivity.this.day_numberpicker.setMaxValue(29);
            else
              JiLuActivity.this.day_numberpicker.setMaxValue(28);
          }
        }
      });
      this.day_numberpicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener()
      {
        public void onValueChange(NumberPicker paramAnonymousNumberPicker, int paramAnonymousInt1, int paramAnonymousInt2)
        {
          JiLuActivity.this.mDay = paramAnonymousInt2;
          LogUtils.i(JiLuActivity.this.TAG, "mDay:" + JiLuActivity.this.mDay);
        }
      });
      this.popupWindowstart.setOutsideTouchable(true);
      this.popupWindowstart.setFocusable(true);
      this.popupWindowstart.setBackgroundDrawable(this.context.getResources().getDrawable(2130838170));
      this.popupWindowstart.showAsDropDown(this.et_begin_time, 0, 0);
      this.popupWindowstart.setOnDismissListener(new PopupWindow.OnDismissListener()
      {
        private String month;

        public void onDismiss()
        {
          JiLuActivity.this.img_begin_time.setImageResource(2130837881);
          String str1 = JiLuActivity.this.mYear;
          String str2 = JiLuActivity.this.format(JiLuActivity.this.mMonth);
          String str3 = JiLuActivity.this.format(JiLuActivity.this.mDay);
          String str4 = str1 + "-" + str2 + "-" + str3;
          JiLuActivity.this.et_begin_time.setText(str4);
        }
      });
      return;
      label431: if ((k == 4) || (k == 6) || (k == 9) || (k == 11))
        this.day_numberpicker.setMaxValue(30);
      else if (j / 4 == 0)
        this.day_numberpicker.setMaxValue(29);
      else
        this.day_numberpicker.setMaxValue(28);
    }
  }

  @SuppressLint({"NewApi"})
  @TargetApi(12)
  private void showendtimePopwindow()
  {
    this.img_xiala_end_time.setImageResource(2130837882);
    int i = 6 * (CustomApplication.app.displayMetrics.widthPixels / 10);
    NumberPicker localNumberPicker;
    int j;
    int k;
    if (this.popupWindowEnd == null)
    {
      View localView = LayoutInflater.from(this.context).inflate(2130903178, null);
      this.popupWindowEnd = new PopupWindow(localView, -2, -2, true);
      LinearLayout localLinearLayout = (LinearLayout)localView.findViewById(2131099762);
      ViewGroup.LayoutParams localLayoutParams = localLinearLayout.getLayoutParams();
      localLayoutParams.width = i;
      localLinearLayout.setLayoutParams(localLayoutParams);
      this.day_numberpicker = ((NumberPicker)localView.findViewById(2131100237));
      this.day_numberpicker.setMinValue(1);
      this.day_numberpicker.setMaxValue(30);
      this.mDay1 = this.calendar.get(5);
      this.day_numberpicker.setValue(this.mDay1);
      localNumberPicker = (NumberPicker)localView.findViewById(2131100234);
      localNumberPicker.setMaxValue(this.calendar.get(1));
      localNumberPicker.setMinValue(2015);
      this.mYear1 = this.calendar.get(1);
      localNumberPicker.setValue(this.mYear1);
      j = localNumberPicker.getValue();
      this.month_numberpicker = ((NumberPicker)localView.findViewById(2131100236));
      this.month_numberpicker.setMaxValue(12);
      this.month_numberpicker.setMinValue(1);
      this.mMonth1 = (1 + this.calendar.get(2));
      this.month_numberpicker.setValue(this.mMonth1);
      k = this.month_numberpicker.getValue();
      if ((k != 1) && (k != 3) && (k != 5) && (k != 7) && (k != 8) && (k != 10) && (k != 12))
        break label431;
      this.day_numberpicker.setMaxValue(31);
    }
    while (true)
    {
      localNumberPicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener()
      {
        public void onValueChange(NumberPicker paramAnonymousNumberPicker, int paramAnonymousInt1, int paramAnonymousInt2)
        {
          JiLuActivity.this.mYear1 = paramAnonymousInt2;
        }
      });
      this.month_numberpicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener()
      {
        public void onValueChange(NumberPicker paramAnonymousNumberPicker, int paramAnonymousInt1, int paramAnonymousInt2)
        {
          JiLuActivity.this.mMonth1 = paramAnonymousInt2;
          if ((paramAnonymousInt2 == 1) || (paramAnonymousInt2 == 3) || (paramAnonymousInt2 == 5) || (paramAnonymousInt2 == 7) || (paramAnonymousInt2 == 8) || (paramAnonymousInt2 == 10) || (paramAnonymousInt2 == 12))
            JiLuActivity.this.day_numberpicker.setMaxValue(31);
          while (true)
          {
            LogUtils.i(JiLuActivity.this.TAG, "mMonth1:" + JiLuActivity.this.mMonth1);
            return;
            if ((paramAnonymousInt2 == 4) || (paramAnonymousInt2 == 6) || (paramAnonymousInt2 == 9) || (paramAnonymousInt2 == 11))
              JiLuActivity.this.day_numberpicker.setMaxValue(30);
            else if (JiLuActivity.this.mYear1 / 4 == 0)
              JiLuActivity.this.day_numberpicker.setMaxValue(29);
            else
              JiLuActivity.this.day_numberpicker.setMaxValue(28);
          }
        }
      });
      this.day_numberpicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener()
      {
        public void onValueChange(NumberPicker paramAnonymousNumberPicker, int paramAnonymousInt1, int paramAnonymousInt2)
        {
          JiLuActivity.this.mDay1 = paramAnonymousInt2;
          LogUtils.i(JiLuActivity.this.TAG, "mDay1:" + JiLuActivity.this.mDay1);
        }
      });
      this.popupWindowEnd.setOutsideTouchable(true);
      this.popupWindowEnd.setFocusable(true);
      this.popupWindowEnd.setBackgroundDrawable(this.context.getResources().getDrawable(2130838170));
      this.popupWindowEnd.showAsDropDown(this.et_end_tiem, 0, 0);
      this.popupWindowEnd.setOnDismissListener(new PopupWindow.OnDismissListener()
      {
        public void onDismiss()
        {
          JiLuActivity.this.img_xiala_end_time.setImageResource(2130837881);
          String str1 = JiLuActivity.this.mYear1;
          String str2 = JiLuActivity.this.format(JiLuActivity.this.mMonth1);
          String str3 = JiLuActivity.this.format(JiLuActivity.this.mDay1);
          String str4 = str1 + "-" + str2 + "-" + str3;
          JiLuActivity.this.et_end_tiem.setText(str4);
        }
      });
      return;
      label431: if ((k == 4) || (k == 6) || (k == 9) || (k == 11))
        this.day_numberpicker.setMaxValue(30);
      else if (j / 4 == 0)
        this.day_numberpicker.setMaxValue(29);
      else
        this.day_numberpicker.setMaxValue(28);
    }
  }

  @SuppressLint({"NewApi"})
  @TargetApi(12)
  private void showgametypePopwindow()
  {
    this.img_xiala_game_type.setImageResource(2130837882);
    View localView = LayoutInflater.from(this.context).inflate(2130903151, null);
    final PopupWindow localPopupWindow = new PopupWindow(localView, 400, -2, true);
    final TextView localTextView1 = (TextView)localView.findViewById(2131100169);
    final TextView localTextView2 = (TextView)localView.findViewById(2131100170);
    final TextView localTextView3 = (TextView)localView.findViewById(2131100171);
    localTextView1.setText("全部");
    localTextView2.setText("加拿大28");
    localTextView3.setText("北京28");
    localTextView1.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        JiLuActivity.this.et_game_type.setText(localTextView1.getText());
        localPopupWindow.dismiss();
      }
    });
    localTextView2.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        JiLuActivity.this.et_game_type.setText(localTextView2.getText());
        localPopupWindow.dismiss();
      }
    });
    localTextView3.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        JiLuActivity.this.et_game_type.setText(localTextView3.getText());
        localPopupWindow.dismiss();
      }
    });
    localPopupWindow.setOutsideTouchable(true);
    localPopupWindow.setFocusable(true);
    localPopupWindow.setBackgroundDrawable(this.context.getResources().getDrawable(2130838170));
    localPopupWindow.showAsDropDown(this.et_game_type, 0, 0);
    localPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener()
    {
      public void onDismiss()
      {
        JiLuActivity.this.img_xiala_game_type.setImageResource(2130837881);
      }
    });
  }

  @SuppressLint({"NewApi"})
  @TargetApi(12)
  private void showrecordtypePopwindow()
  {
    this.img_xiala_record_type.setImageResource(2130837882);
    View localView = LayoutInflater.from(this.context).inflate(2130903152, null);
    final PopupWindow localPopupWindow = new PopupWindow(localView, 400, -2, true);
    final TextView localTextView1 = (TextView)localView.findViewById(2131100169);
    final TextView localTextView2 = (TextView)localView.findViewById(2131100170);
    final TextView localTextView3 = (TextView)localView.findViewById(2131100171);
    final TextView localTextView4 = (TextView)localView.findViewById(2131100174);
    LinearLayout localLinearLayout = (LinearLayout)localView.findViewById(2131100173);
    localTextView1.setText("投注记录");
    localLinearLayout.setVisibility(8);
    localTextView2.setText("加拿大28");
    localTextView1.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        JiLuActivity.this.et_record_type.setText(localTextView1.getText());
        localPopupWindow.dismiss();
      }
    });
    localTextView2.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        JiLuActivity.this.et_record_type.setText(localTextView2.getText());
        localPopupWindow.dismiss();
      }
    });
    localTextView3.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        JiLuActivity.this.et_record_type.setText(localTextView3.getText());
        localPopupWindow.dismiss();
      }
    });
    localTextView4.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        JiLuActivity.this.et_record_type.setText(localTextView4.getText());
        localPopupWindow.dismiss();
      }
    });
    localPopupWindow.setOutsideTouchable(true);
    localPopupWindow.setFocusable(true);
    localPopupWindow.setBackgroundDrawable(this.context.getResources().getDrawable(2130838170));
    localPopupWindow.showAsDropDown(this.et_record_type, 0, 0);
    localPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener()
    {
      public void onDismiss()
      {
        JiLuActivity.this.img_xiala_record_type.setImageResource(2130837881);
      }
    });
  }

  public String format(int paramInt)
  {
    String str = String.valueOf(paramInt);
    if (paramInt < 10)
      str = "0" + str;
    return str;
  }

  public void onClick(View paramView)
  {
    switch (paramView.getId())
    {
    default:
      return;
    case 2131099875:
    }
    String str1 = this.et_begin_time.getText().toString();
    String str2 = this.et_end_tiem.getText().toString();
    if ("".equals(str1))
    {
      UiUtil.showToast(this.context, "请选择您的开始时间");
      return;
    }
    if ("".equals(str2))
    {
      UiUtil.showToast(this.context, "请选择您的结束时间");
      return;
    }
    if (DateUtil.getTime(str1, "yyyy-MM-dd") > DateUtil.getTime(str2, "yyyy-MM-dd"))
    {
      ShowDialog1("开始时间超过了结束时间");
      return;
    }
    Intent localIntent = new Intent(this, JiResultActivity.class);
    if ("北京28".equals(this.et_game_type.getText().toString()))
      localIntent.putExtra("lotteryid", "1");
    while (true)
    {
      localIntent.putExtra("startdate", str1);
      localIntent.putExtra("enddate", str2);
      startActivity(localIntent);
      return;
      if ("全部".equals(this.et_game_type.getText().toString()))
        localIntent.putExtra("lotteryid", "0");
      else
        localIntent.putExtra("lotteryid", "3");
    }
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    this.context = this;
    this.contentView = LayoutInflater.from(this.context).inflate(2130903061, null);
    setContentView(this.contentView);
    CustomApplication.app.addActivity(this);
    this.calendar = Calendar.getInstance();
    setTitle(8, 0, 2130837809, "游戏记录", 0, 8, 8, 0, true);
    this.rl_game_type = ((RelativeLayout)findViewById(2131099862));
    this.rl_game_type.setOnClickListener(this.onClickListener);
    this.rl_end_time = ((RelativeLayout)findViewById(2131099872));
    this.rl_end_time.setOnClickListener(this.onClickListener);
    this.et_game_type = ((EditText)findViewById(2131099863));
    this.et_game_type.setText("全部");
    this.et_game_type.setInputType(0);
    this.img_xiala_game_type = ((ImageView)findViewById(2131099864));
    this.img_xiala_game_type.setOnClickListener(this.onClickListener);
    this.et_record_type = ((EditText)findViewById(2131099867));
    this.et_record_type.setText("投注记录");
    this.et_record_type.setInputType(0);
    this.et_record_type.setOnClickListener(this.onClickListener);
    this.img_xiala_record_type = ((ImageView)findViewById(2131099868));
    this.img_xiala_record_type.setOnClickListener(this.onClickListener);
    this.et_begin_time = ((EditText)findViewById(2131099870));
    this.et_begin_time.setInputType(0);
    this.et_begin_time.setOnClickListener(this.onClickListener);
    this.img_begin_time = ((ImageView)findViewById(2131099871));
    this.img_begin_time.setOnClickListener(this.onClickListener);
    this.et_end_tiem = ((EditText)findViewById(2131099873));
    this.et_end_tiem.setInputType(0);
    this.et_end_tiem.setOnClickListener(this.onClickListener);
    this.img_xiala_end_time = ((ImageView)findViewById(2131099874));
    this.img_xiala_end_time.setOnClickListener(this.onClickListener);
    this.img_qd = ((ImageView)findViewById(2131099875));
    this.img_qd.setOnClickListener(this);
    this.lin_record_type = ((LinearLayout)findViewById(2131099865));
    this.lin_record_type.setVisibility(8);
    String str1 = format(1 + this.calendar.get(2));
    String str2 = format(this.calendar.get(5));
    this.et_begin_time.setText(this.calendar.get(1) + "-" + str1 + "-" + str2);
    this.et_end_tiem.setText(this.calendar.get(1) + "-" + str1 + "-" + str2);
  }

  public void onValueChange(NumberPicker paramNumberPicker, int paramInt1, int paramInt2)
  {
    paramNumberPicker.getId();
  }

  @SuppressLint({"NewApi"})
  public void setTitle(int paramInt1, int paramInt2, int paramInt3, String paramString, int paramInt4, int paramInt5, int paramInt6, int paramInt7, boolean paramBoolean)
  {
    View localView = findViewById(2131099716);
    if (paramBoolean)
      localView.setVisibility(0);
    while (true)
    {
      ((TextView)localView.findViewById(2131099701)).setText(paramString);
      ((TextView)localView.findViewById(2131099700)).setVisibility(paramInt1);
      ImageView localImageView = (ImageView)localView.findViewById(2131099699);
      localImageView.setVisibility(paramInt2);
      localImageView.setOnClickListener(this.onClickListener);
      localImageView.setImageResource(paramInt3);
      TextView localTextView = (TextView)localView.findViewById(2131099702);
      localTextView.setVisibility(paramInt5);
      localTextView.setOnClickListener(this.onClickListener);
      this.iv_title_right = ((ImageView)localView.findViewById(2131099704));
      this.iv_title_right.setVisibility(paramInt6);
      this.iv_title_right.setOnClickListener(this.onClickListener);
      this.iv_title_right.setImageResource(paramInt7);
      return;
      localView.setVisibility(8);
    }
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.hsc.yalebao.tabMine.JiLuActivity
 * JD-Core Version:    0.6.2
 */